<form action="/backend/node/records" method="get" class="filter">
    <label for="type">类型</label>
    <select name="type">
	<option value="0">全部</option>
	<option value="1">目录</option>
	<option value="2">图片</option>
    </select>
    <label for="label">名称</label>
    <input type="text" class="text" name="label" autocomplete="off"/>

    <label for="created_at">上传时间</label> 从<input type="text" class="text datetime" name="start" autocomplete="off"/>到<input type="text" class="text datetime" name="end" autocomplete="off"/>
    <input type="submit" class="submit" value="检索"/>
</form>

<ul class="button">
    <li><a href="javascript:void(0);" class="add-image">添加图片</a></li>
    <li><a href="javascript:void(0);" class="add-folder">添加目录</a></li>
    <!--<li><a href="javascript:void(0);" class="rename">重命名</a></li>-->
    <!--<li><a href="javascript:void(0);" class="copy">复制</a></li>-->
    <li><a href="javascript:void(0);" class="cut">剪切</a></li>
    <li><a href="javascript:void(0);" class="paste">粘贴</a></li>
    <li class="right"><a href="javascript:void(0);" class="page-size">20</a></li>
    <li class="right"><a href="javascript:void(0);" class="page-size">50</a></li>
    <li class="right"><a href="javascript:void(0);" class="page-size">100</a></li>
</ul>

<ul class="parents">
    <li><a href="javascript:void(0);" class="parent" data="0">顶级</a></li>
</ul>

<!--
<table class="records">
	<thead>
		<tr>
			<th><input type="checkbox" value="0" class="select-all"/></th>
			<th><a href="javascript:void(0);">parent</a></th>
			<th><a href="javascript:void(0);">type</a></th>
			<th><a href="javascript:void(0);">label</a></th>
			<th><a href="javascript:void(0);">name</a></th>
			<th><a href="javascript:void(0);">created_at</a></th>
			<th>操作</th>
		</tr>
	</thead>
	<tfoot><tr><td colspan="6"></td></tr></tfoot>
	<tbody><tr><td colspan="6"></td></tr></tbody>
</table>
-->

<ul class="records">
    <li data="10">
	<a href="javascript:void(0);">
	    <img src="/assets/img/404.jpg" alt="404"/>
	</a>
	<div class="actions">
	    <a href="javascript:void(0);" class="edit">	编辑</a>
	    <a href="javascript:void(0);" class="delete">删除</a>
	</div>
    </li>
</ul>

<div class="pagination"></div>

<script type="text/x-jquery-tmpl" id="rename-form-template">
    <form action="/backend/node/rename" method="post">
	<input type="hidden" name="id" value="${id}"/>
	<div class="form-row">
	    <label for="label">名称</label>
	    <input type="text" class="text" name="label" value="${label}"/>
	</div>
	<div class="form-button">
	    <input type="submit" class="submit" value="提交"/>
	</div>
    </form>
</script>

<script type="text/x-jquery-tmpl" id="folder-form-template">
    <form action="/backend/folder/insert" method="post">
	<input type="hidden" name="parent" value="${parent}"/>
	<div class="form-row">
	    <label for="label">名称</label>
	    <input type="text" class="text" name="label" value="${label}"/>
	</div>
	<div class="form-button">
	    <input type="submit" class="submit" value="提交"/>
	</div>
    </form>
</script>

<script type="text/x-jquery-tmpl" id="image-form-template">
    <form action="/backend/image/insert" method="post" enctype="multipart/form-data" target="submit-target">
	<input type="hidden" name="callback" value="${callback}"/>
	<input type="hidden" name="parent" value="${parent}"/>
	<div class="form-row">
	    <label for="label">名称</label>
	    <input type="text" class="text" name="label" value="${label}"/>
	</div>
	<div class="form-row">
	    <label for="sizes">图片类型</label>
	    <select name="sizes">
		<option value="150_150">请选择</option>
		<?php foreach($types as $type):?>
		    <option value="<?php echo $type['sizes']; ?>"><?php echo $type['name']; ?></option>
		<?php endforeach; ?>
	    </select>
	</div>
	<div class="form-row">
	    <label for="file">图片</label>
	    <input type="file" name="file"/>
	</div>
	<div class="form-button">
	    <input type="submit" class="submit" value="提交"/>
	</div>
    </form>
    <iframe name="submit-target" style="widht:0;height:0;display:none;"></iframe>
</script>

<script type="text/x-jquery-tmpl" id="list-template">
    <li data="${id}" title="${label}" type="${type}">
	<a href="javascript:void(0);" class="list">
	    {{if type==1}}
	    <span class="image-container">
		<img src="/assets/img/folder.png" alt="${label}"/>
	    </span>
	    {{/if}}
	    {{if type==2}}
	    <span class="image-container">
		<img src="/assets/upload/img/${$item.thumbnail(name)}" alt="${label}"/>
	    </span>
	    {{/if}}
	    <span class="label">${$item.substr(label,10)}</span>
	    <span class="created_at">${created_at}</span>
	</a>
	<div class="actions">
	    {{if type==2}}
	    <a href="/backend/image/edit/${id}" title="编辑">编辑</a>
	    {{/if}}
	    <a href="javascript:void(0);" class="rename" title="重命名">重命名</a>
	    <a href="javascript:void(0);" class="delete" title="删除">删除</a>
	</div>
	<div class="cut-mask"></div>
    </li>
</script>

<script type="text/x-jquery-tmpl" id="none-template">
    <tr><td colspan="6" style="text-align: center;">没有搜索到结果。</td></tr>
</script>